package cqie.edu.bootexperiment3;

import cqie.edu.bootexperiment3.domain.TCustomer;
import cqie.edu.bootexperiment3.domain.TOrder;
import cqie.edu.bootexperiment3.mapper.TCustomerMapper;
import cqie.edu.bootexperiment3.mapper.TOrderMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@SpringBootTest
public class test_insert {
    //229970608 何慧君
    @Autowired
    TCustomerMapper tCustomerMapper;

    @Autowired
    TOrderMapper tOrderMapper;
    @Test
    public void test_insert() {
        TCustomer customer1 = new TCustomer(1, "张三", "程序员", "18575454152",1);
        TCustomer customer2 = new TCustomer(2, "王五", "程序员", "18575454155",1);
        TCustomer customer3 = new TCustomer(3, "张利", "架构师", "18575454133",0);

        tCustomerMapper.insertUser(customer1);
        tCustomerMapper.insertUser(customer2);
        tCustomerMapper.insertUser(customer3);
    }


    @Test
    public void test_insertOrder() {
        //229970608  何慧君
        TOrder tOrder1 = new TOrder(1, "10001", BigDecimal.valueOf(125),1);
        TOrder tOrder2 = new TOrder(2, "10002", BigDecimal.valueOf(251),1);
        TOrder tOrder3 = new TOrder(3, "10003", BigDecimal.valueOf(785),2);
        tOrderMapper.insertOrder(tOrder1);
        tOrderMapper.insertOrder(tOrder2);
        tOrderMapper.insertOrder(tOrder3);
    }



}
